package com.iap.common.translator
{
	import com.iap.app.translator.Translator;
	import com.iap.common.model.VectorImage;
	
	import flash.utils.getQualifiedClassName;
	
	public class VectorImageTranslator extends Translator
	{
		public static function translate(item:Object):Object
		{
			if(getQualifiedClassName(item) == "Array")
			{
				return translateFromArray(item as Array);
			} else {
				return translateFromObject(item, getQualifiedClassName(VectorImage)) as VectorImage;
			}
		}
		
		public static function translateFromArray(data:Array):Array
		{
			var list:Array = new Array();
			for each(var item:Object in data)
			{
				list.push(translateFromObject(item, getQualifiedClassName(VectorImage)) as VectorImage);
			}
			return list;
		}
	}
}